<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet"
			href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
#accountInfo .box-header {
	padding: 19px;
}

#statistics .box-title {
	font-size: 16px;
}

#vol p:nth-child(2) {
	font-size: 15px;
}

select {
	color: black;
}

.ui-autocomplete-input {
	width: 100%;
}
</style>
	</ui:define>
	<ui:define name="content">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button"
				styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button"
				styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div class='full-center-content-scroll-noheader'>
			<div class="nav-tabs-custom">
				<ul class="nav nav-tabs pull-left ">
					<li class="active"><a href="#accountInfo" data-toggle="tab">属性分组</a></li>
				</ul>
				<div class="tab-content no-padding">
					<div class="chart tab-pane active" id="accountInfo"
						style="position: relative">
						<div class="row">
							<div class="col-md-3 full-content">
								<div class="box box-primary">
									<div class="box-header with-border" id="searchInput">
										<div class="box-tools pull-left" style="left:0px">
											<h:form id="form1">
												<p:growl id="msg" showDetail="true" />
												<!-- <p:commandButton value="新增" id="createRootBtn" actionListener="#{pamaraterConfigController.createRoot}"
													oncomplete="PF('createRootDlg').show()" process="@this" icon="fa fa-plus" update="form1:createRootDlg"/> -->
												<p:toolbar>
													<f:facet name="left">
														<p:commandButton value="编辑" id="editRootBtn"
															rendered="#{s:hasPermission(session,'xtsz_xtcs_bjfz')}"
															oncomplete="PF('createRootDlg').show()" process="@this"
															update="createRootDlg"
															disabled="#{pamaraterConfigController.currentSelect==null}"
															actionListener="#{pamaraterConfigController.editRoot}"
															icon="fa fa-pencil" />
													</f:facet>
												</p:toolbar>
												<!-- <p:commandButton value="删除" id="delRootBtn" disabled="#{pamaraterConfigController.currentSelect==null}"
													actionListener="#{pamaraterConfigController.deleteRootById}"
													update="form2:tree :form3:configTb form3:delBtn form3:editBtn form3:createBtn msg form1:editRootBtn form1:delRootBtn"
													icon="fa fa-trash">
													<p:confirm header="提示" message="确定要删除么？" icon="ui-icon-alert" />
												</p:commandButton> -->
												<p:dialog widgetVar="createRootDlg" header="属性分组"
													modal="true" id="createRootDlg" width="350" height="160">
													<p:toolbar>
														<f:facet name="left">
															<p:commandButton id="createRootSaveBtn" value="保存"
															actionListener="#{pamaraterConfigController.saveRoot}" update="form2:tree editRootBtn "
															oncomplete="PF('createRootDlg').hide()" con="fa fa-floppy-o" />
														</f:facet>
													</p:toolbar>
													<p:outputPanel id="createRootDetail"
														style="text-align:center;">
														<p:panelGrid columns="2">
															<h:outputText value="属性组名称" />
															<p:inputText label="nameRoot"
																value="#{pamaraterConfigController.currentRoot.name}"></p:inputText>
														</p:panelGrid>
													</p:outputPanel>
												</p:dialog>
											</h:form>
										</div>
									</div>
									<div class="box-body  full-content-scroll">
										<h:form id="form2">
											<p:tree value="#{pamaraterConfigController.root}"
												style="width:400px;border:none" selectionMode="single"
												var="node" dynamic="true" id="tree" widgetVar="tree"
												animate="true">
												<p:ajax event="select" process="@this"
													update=" :form3:configTb  form1:editRootBtn "
													listener="#{pamaraterConfigController.onNodeSelect}" />
												<p:treeNode type="root" icon="fa fa-cogs">
													<h:outputText value="#{node}" />
												</p:treeNode>
											</p:tree>
										</h:form>
									</div>
									<div class="box-footer"></div>
								</div>
							</div>
							<div class="col-md-9 full-content">
								<div class="box box-primary">
									<div class="box-body full-content-scroll ">
										<h:form id="form3">
											<p:growl id="msgs" showDetail="true" />
											<p:toolbar id="btnBar" rendered="#{s:hasPermission(session,'xtsz_xtcs_bjsj')}">
												<f:facet name="left">
													<!-- <p:commandButton value="新增" id="createBtn" disabled="#{pamaraterConfigController.currentSelect ==null}"
														oncomplete="PF('createDlg').show()" process="@this" actionListener="#{pamaraterConfigController.create}"
														update="form3:createDlg" icon="fa fa-plus" /> -->
													<p:commandButton value="编辑" id="editBtn"
														rendered="#{s:hasPermission(session,'xtsz_xtcs_bjsj')}"
														disabled="#{pamaraterConfigController.selected.id ==null}"
														oncomplete="PF('createDlg').show()" process="@this"
														actionListener="#{pamaraterConfigController.edit}"
														update="form3:createDlg" icon="fa fa-pencil" />
													<!-- <p:commandButton value="删除" id="delBtn" disabled="#{pamaraterConfigController.selected.id ==null}"
														actionListener="#{pamaraterConfigController.deleteById}"
														update="form3:msgs form3:configTb form3:delBtn form3:editBtn" icon="fa fa-trash">
														<p:confirm header="提示" message="确定要删除么？" icon="ui-icon-alert" />
													</p:commandButton> -->
												</f:facet>
											</p:toolbar>
											<p:dataTable id="configTb" var="config" emptyMessage="无记录"
												value="#{pamaraterConfigController.paramConfigs}"
												rowKey="#{config.id}" rowIndexVar="ite"
												selection="#{pamaraterConfigController.selected}"
												style="margin-bottom:20px">
												<p:ajax event="rowSelectRadio" update="form3:editBtn  configTb" />
												<p:column selectionMode="single" style="text-align:center;width:60px" />
												<p:column headerText="序号 " style="width:60px;text-align:center">
													<h:outputText value="#{ite+1}" />
												</p:column>
												<p:column headerText="参数名称" style="width:30%;">
													<h:outputText value="#{config.name}" />
												</p:column>
												<p:column headerText="参数类型" style="width:20%;">
													<h:outputText value="#{config.type}" />
												</p:column>
												<p:column headerText="参数值" style="width:30%;">
													<h:outputText value="#{config.value}" />
												</p:column>
												<p:column headerText="备注" style="width:20%;">
													<h:outputText value="#{config.description}" />
												</p:column>
											</p:dataTable>
											<p:dialog widgetVar="createDlg" header="编辑参数" modal="true"
												id="createDlg" resizable="false" width="570" height="380">
												<p:toolbar>
													<f:facet name="left">
														<p:commandButton id="createSaveBtn" value="保存"
															icon="fa fa-floppy-o"
															update="form3:configTb form3:msgs  form3:editBtn "
															actionListener="#{pamaraterConfigController.save}"
															oncomplete="PF('createDlg').hide()" />
													</f:facet>
												</p:toolbar>
												<p:panelGrid columns="2" style="width:100%;margin-top:8px">
													<h:outputText value="参数名称" />
													<p:inputText label="name" style="width:100%"
														value="#{pamaraterConfigController.current.name}"></p:inputText>
													<h:outputText value="参数类型" />
													<!-- <p:inputText label="desc" value="#{pamaraterConfigController.current.type}"></p:inputText> -->
													<p:selectOneMenu
														value="#{pamaraterConfigController.current.type}"
														style="width:100%">
														<f:selectItem itemLabel="String" itemValue="String" />
														<f:selectItem itemLabel="Integer" itemValue="Integer" />
														<f:selectItem itemLabel="Double" itemValue="Double" />
														<f:selectItem itemLabel="Float" itemValue="Float" />
														<f:selectItem itemLabel="Long" itemValue="Long" />
														<f:selectItem itemLabel="Date" itemValue="Date" />
													</p:selectOneMenu>
													<h:outputText value="参数值" />
													<h:inputTextarea style="width:100%" rows="3"
														value="#{pamaraterConfigController.current.value}"></h:inputTextarea>
													<h:outputText value="描述" />
													<p:inputText style="width:100%"
														value="#{pamaraterConfigController.current.description}"></p:inputText>
												</p:panelGrid>
											</p:dialog>
										</h:form>
									</div>
									<div class="box-footer"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/plugins/datatables/jquery.dataTables.js"></script>
		<script
			src="/resources/plugins/datatables/dataTables.bootstrap.min.js"></script>
		<script src="/resources/js/tables/mytable.js"></script>
		<script src="/resources/js/mymodal.js"></script>
	</ui:define>
</ui:composition>
